



use "${pathdata_baseline}/BaselineExperiment_withError.dta", clear

drop if condition_ == "noinfo"

*indicator = 1 if in story treatment
gen story = 0 
replace story = 1 if inlist(condition_, "storyshort_neg", "storyshort_pos")

preserve

*only keep consistent stories
keep if story_type == "consistent"
drop if condition_ == "noinfo"
eststo clear

*Column (I): immediate effect (Y) story dummy (X)
eststo reg1: areg effect story, absorb(prolific_pid) cluster(prolific_pid)
estadd scalar x = _b[_cons]

*Column (II): delayed effect (Y) story dummy (X)
eststo reg2: areg effect_recall story, absorb(prolific_pid) cluster(prolific_pid)
estadd scalar x = _b[_cons]

gen id= _n
	
*Make the data long to have both immediate and delayed Belief Impact in one column
reshape long effec, i(id) j(delay) string

*only keep consistent stories

*indicator = 1 if delayed Belief Impact
gen delaydum = 0
replace delaydum = 1 if delay =="t_recall"
label variable delaydum "Delay"

gen storyXdelay = 0
replace storyXdelay = 1 if story == 1 & delaydum == 1



rename effec effect_total

*Column (III): Belief Impact delay and immediate pooled (Y) delay and story indicators (X)
eststo reg3: areg effect_total story delaydum storyXdelay, absorb(prolific_pid) cluster(prolific_pid)
estadd scalar x = _b[_cons]

restore

use "${pathdata_baseline}/BaselineExperimentRecall_withError.dta", clear

*only keep consistent stories
keep if story_type == "consistent"
drop if condition_ == "noinfo"

*Column (IV): Correct recall of information of type + valence (Y) indicator for story treatment (X)
eststo reg4: areg recallcombined story, absorb(prolific_pid) cluster(prolific_pid)
estadd scalar x = _b[_cons]

	
	
	
*This is required in order to show participant Fixed effects Yes/No in the table.
	*estfe reg1 reg2 reg3 reg4, labels(prolific_pid "Participant FE")
	
	esttab reg1 reg2 reg3 reg4 using "${pathout_baseline}/tables/tableA6.tex", ///
		booktabs nonotes replace label nomtitles ///
		keep(story delaydum storyXdelay) order(story delaydum storyXdelay) coeflabels( story "Story" delaydum "Delay" storyXdelay "Story $/times$ Delay" _cons "Control Mean") ///
		se(2) b(a2) stats(x N r2, fmt(2 0 2) label("Control Mean" "Observations" "R^2")) star(* 0.10 ** 0.05 *** 0.01) ///
		prehead("{\begin{tabular}{l*{4}{c}}\toprule\toprule&\multicolumn{4}{c}{\textit{Dependent variable:}}//[.1cm] &\multicolumn{3}{c}{Belief Impact} &  \multicolumn{1}{c}{Combined Recall} // \cmidrule(lr){2-4} \cmidrule(lr){5-5} // \textit{Sample:} &\multicolumn{1}{c}{Immediate} &\multicolumn{1}{c}{Delay} &\multicolumn{1}{c}{Pooled} &\multicolumn{1}{c}{Consistent}//")

